<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录框</title>
<link rel="stylesheet" type="text/css" href="css/login.css" />
<script>
window.onload=function ()
{
	var oDiv=document.getElementById('login');
	
	oDiv.onmousedown=function (ev)
	{
		var oEvent=ev||event;
		
		var disX=oEvent.clientX-oDiv.offsetLeft;
		var disY=oEvent.clientY-oDiv.offsetTop;
		
		document.onmousemove=function (ev)
		{
			var oEvent=ev||event;
			var aLeft=oEvent.clientX-disX;
			var aTop=oEvent.clientY-disY;
			if(aLeft<0)
			{
				aLeft=0;
			}else if(aLeft>document.documentElement.clientWidth-oDiv.offsetWidth)
	                {
		                aLeft=document.documentElement.clientWidth-oDiv.offsetWidth;
	                }
			if(aTop<0)
			{
				aTop=0;
			}else if(aTop>document.documentElement.clientHeight-oDiv.offsetHeight)
					{
						aTop=document.documentElement.clientHeight-oDiv.offsetHeight	
					}
			oDiv.style.left=aLeft+'px';
			oDiv.style.top=aTop+'px';
			
		};
		
		document.onmouseup=function ()
		{
			document.onmousemove=null;
			document.onmouseup=null;
		};
	};
};
</script>
</head>

<body>
<div id="login">
	<div>
    	登录提示
    </div>
	<ul>
    	<form method="post" action="check">
            <li>账号：<input type="text" id="user_id" placeholder="请输入账号"  name="user_id"/></li>
            <li>密码：<input type="password" id="user_password" placeholder="请输入密码" name="user_password"/></li>
            <li>验证码：<input type="text" id="login_check" placeholder="请输入验证码" /><span>1234</span></li>
            <li><input type="button" id="login_submit" value="登录" /></li>
            <li><input type="checkbox" id="remember"  />记住账号<a href="###">注册</a><a href="###">忘记密码</a></li>
        </form>
    </ul>
</div>
<div id="div1">
</div>
</body>
</html>
